package cn.sinata.wanglin.neighbor.activity;

import android.os.Bundle;
import android.support.annotation.NonNull;

import com.xilada.xldutils.activitys.BaseActivity;
import com.xilada.xldutils.utils.SharedPreferencesUtils;

import cn.sinata.wanglin.R;
import cn.sinata.wanglin.neighbor.fragment.ChatFragment;

public class ChatActivity extends BaseActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat);
        initView();
    }

    protected void initView() {

        ChatFragment fragment = new ChatFragment();
        fragment.setArguments(getIntent().getExtras());
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.activity_chat,fragment)
                .commitAllowingStateLoss();
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        if (permissions.length > 0) {
            SharedPreferencesUtils.save(permissions[0],false);
        }
    }
}
